#pragma once
#include"HashTable.h"


namespace Zhj
{
	template<class K>
	struct SetkeyofT
	{
		K operator()(const K&key)
		{
			return key;
		}
	};

	


	template <class K>
	class unordered_set
	{
		typedef typename HashBucket::HashTable<K, K, SetkeyofT<K>> ::const_iterator iterator;
		typedef typename HashBucket::HashTable<K, K, SetkeyofT<K>> ::const_iterator const_iterator;
		//typedef HashBucket::__Iterator<K, K, K&, K*, SetkeyofT<K>> iterator;



	public:
		pair<iterator,bool> insert(const K& key)
		{
			return _ht.Insert(key);
		}

		void print()
		{
			return _ht.printSet();
		}

		iterator begin()
		{
			return _ht.begin();
		}


		iterator end()
		{
			return _ht.end();
		}

		void test1()
		{
			Zhj::unordered_set<int> t;
			t.insert(1);
			t.insert(2);
			t.insert(3);
			iterator it = t.begin();
			while (it != t.end())
			{
				*it += 1;
				cout << *it << endl;
				
				++it;
			}
		}
	private:
		HashBucket::HashTable<K,K, SetkeyofT<K>> _ht;
	};


	
}